<?php if(!defined('BASEPATH'))exit('No direct script access allowed'); ?>
<?php $this->load->view('admin/global/header'); ?>
<?php $this->load->view('admin/global/left'); ?>
<table cellpadding="0" cellspacing="0">
    <tr>
        <td class="title"><?php echo lang('LIST').': '.lang('SHOP'); ?></td>
    </tr>
    <?php if(isset($denied)){ ?>
    <tr>
        <td class="bar">
            <div class="error"><?php echo lang('DENIED'); ?></div>
            <meta http-equiv="refresh" content="5; <?php echo base_url().ADMIN_PATH; ?>" />
        </td>
    </tr>
    <?php }else{ ?>
    <?php echo Modules::run('admin/bar_module/index', $buttons, $searchs, $filters); ?>
    <tr>
        <td valign="top">
        <form name="frmView" id="frmView" method="post">
            <table class="view" cellpadding="0" cellspacing="0">
                <tr class="title">
                    <td class="index">#</td>
                    <td width="20">
                        <input type="checkbox" name="checkAll" id="checkAll" value="0" />
                    </td>
                    <?php echo Modules::run('admin/sort_module/index', 'name', lang('SHOP')); ?>
                    <?php echo Modules::run('admin/sort_module/index', 'section', lang('SECTION')); ?>
                    <?php echo Modules::run('admin/sort_module/index', 'category', lang('CATEGORY')); ?>
                    <?php echo Modules::run('admin/sort_module/index', 'user', lang('BOSS_SHOP')); ?>
                    <?php echo Modules::run('admin/sort_module/index', 'bestShop', lang('BESTSHOP'), 80); ?>
                    <?php echo Modules::run('admin/sort_module/index', 'level', lang('LEVEL_SHOP'), 110); ?>
                    <?php echo Modules::run('admin/sort_module/index', 'status', lang('ACTIVE'), 80); ?>
                    <?php echo Modules::run('admin/sort_module/index', 'expireBestShop', lang('EXPIRE_DATE'), 110); ?>
                    <?php echo Modules::run('admin/sort_module/index', 'id', lang('ID'), 50); ?>
                </tr>
                <!--LOOP-->
                <?php $index = 1; ?>
                <?php foreach($rows as $row){ ?>
                <tr class="<?php if($index%2 == 0){echo 'bgColor';} ?>">
                    <td class="index"><?php echo $sTT++; ?></td>
                    <td align="center">
                        <input type="checkbox" name="idRecord[]" id="idRecord<?php echo $index; ?>" class="idRecord" value="<?php echo $row->shoID; ?>" />
                    </td>
                    <td>
                        <a href="<?php echo base_url().$row->shoLink; ?>" title="<?php echo lang('VISIT_SHOP'); ?>" target="_blank">
                            <?php echo $row->shoName; ?>
                        </a>
                    </td>
                    <td align="center"><?php echo $row->secName; ?></td>
                    <td align="center"><?php echo $row->catName; ?></td>
                    <td>
                        <?php echo $row->useUsername; ?>
                        <img src="<?php echo base_url(); ?>templates/admin/images/expand.png" class="vtip" title="<?php echo tip(array(lang('FULLNAME')=>$row->useFullname, lang('ADDRESS')=>$row->useAddress, lang('EMAIL')=>$row->useEmail, lang('TEL')=>$row->usePhone)); ?>" align="absmiddle" />
                    </td>
                    <td align="center">
                        <?php if((int)$row->shoBestShop > 0){ ?>
                        <img src="<?php echo base_url(); ?>templates/admin/images/status1.png" onclick="eProc('UNBESTSHOP', 'idRecord<?php echo $index; ?>')" title="<?php echo lang('UNBESTSHOP'); ?>" />
                        <?php }else{ ?>
                        <img src="<?php echo base_url(); ?>templates/admin/images/status0.png" onclick="eProc('BESTSHOP', 'idRecord<?php echo $index; ?>')" title="<?php echo lang('BESTSHOP'); ?>" />
                        <?php } ?>
                    </td>
                    <td align="center">
                    <?php for($i = 1; $i <= 5; $i++){ ?>
                    <?php if($i <= (int)$row->shoLevel){ ?>
                    <img src="<?php echo base_url(); ?>templates/admin/images/starBlue1.png" onclick="levelProc('LEVEL', 'idRecord<?php echo $index; ?>', '<?php echo $i; ?>')" title="<?php echo lang('LEVEL').' '.$i; ?>" />
                    <?php }else{ ?>
                    <img src="<?php echo base_url(); ?>templates/admin/images/starBlue0.png" onclick="levelProc('LEVEL', 'idRecord<?php echo $index; ?>', '<?php echo $i; ?>')" title="<?php echo lang('LEVEL').' '.$i; ?>" />
                    <?php } ?>
                    <?php } ?>
                    </td>
                    <td align="center">
                        <?php if((int)$row->shoStatus == 1){ ?>
                        <img src="<?php echo base_url(); ?>templates/admin/images/status1.png" onclick="eProc('UNACTIVE', 'idRecord<?php echo $index; ?>')" title="<?php echo lang('UNACTIVE'); ?>" />
                        <?php }else{ ?>
                        <img src="<?php echo base_url(); ?>templates/admin/images/status0.png" onclick="eProc('ACTIVE', 'idRecord<?php echo $index; ?>')" title="<?php echo lang('ACTIVE'); ?>" />
                        <?php } ?>
                    </td>
                    <td align="center"><b><?php if((int)$row->shoBestShop > 0){echo date_convert($row->shoBestShop);}else{echo lang('NONE_EXPIRE');} ?></b></td>
                    <td align="center"><?php echo $row->shoID; ?></td>
                </tr>
                <?php $index++; ?>
                <?php } ?>
                <!--LOOP-->
                <?php echo Modules::run('admin/pagination_module/index', $total, 11); ?>
            </table>
            <input type="hidden" name="action" value="" />
            <input type="hidden" name="value" value="" />
        </form>
        </td>
    </tr>
    <?php } ?>
</table>
<?php $this->load->view('admin/global/right'); ?>
<?php $this->load->view('admin/global/footer'); ?>